#include <type_traits>
#include <stdio.h>
using namespace std;

template <typename T, typename Ty>
typename enable_if<sizeof(Ty)==sizeof(T), typename T>::type convertToType(Ty type)
{
	return *(T*)&type;
}

int main()
{
	int i = convertToType<int, float>(46843.0f);
	//int i = convertToType<int, double>(78615.0);
	printf("%i\n",i);
	return 0;
}